<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
    	has_openid();
    }

    public function getCode(){
		$appid = C('APPID');
		$redirect_uri=U('Index/index','','',true);
		$url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appid."&redirect_uri=".$redirect_uri."&response_type=code&scope=snsapi_base#wechat_redirect";
		header("Location:".$url); 
		exit;
	}
}